//
//  DestBasicTableViewCell.m
//  TravelEveryDay
//
//  Created by dlios on 15/10/22.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "DestBasicTableViewCell.h"
#import "BaseHeader.h"
@implementation DestBasicTableViewCell

- (void)awakeFromNib {
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _lineView = [[UIView alloc]initWithFrame:CGRectMake(10 *WIDTH, 0, SCREEN_WIDTH-10, 0.5)];
        _lineView.backgroundColor = [UIColor lightGrayColor];
        _firstLabel = [[UILabel alloc]initWithFrame:CGRectMake(10 * WIDTH, 5 *HEIGHT, SCREEN_WIDTH - 20 *WIDTH, 20 *HEIGHT)];
        _secondLabel = [[UILabel alloc]initWithFrame:CGRectZero];
        _secondLabel.numberOfLines = 0;
        _secondLabel.font = [UIFont systemFontOfSize:13.];
        [self.contentView addSubview:_firstLabel];
        [self.contentView addSubview:_secondLabel];
        [self.contentView addSubview:_lineView];
    }
    return self;
}

- (void)setDataModel:(DestBasicModel *)dataModel {
    _firstLabel.text = dataModel.firstString;
    CGFloat height = [StringWithHeight heightWithText:dataModel.secondString width:SCREEN_WIDTH - 20 *WIDTH  font: [UIFont systemFontOfSize:13.]];
    _secondLabel.frame = CGRectMake(10 * WIDTH, 30 *HEIGHT,  355 *WIDTH, height );
    _secondLabel.text = dataModel.secondString;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
